<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="comm/common :: common_header">
</head>
<body>
<nav class="breadcrumb"><a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                           href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray mt-20"> <span
            class="r">共有数据：<strong th:text="${count}">1</strong>条</span></div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="9">日志列表</th>
        </tr>
        <tr class="text-c">
            <th width="25"><input type="checkbox" name="" value=""></th>
            <th width="40">ID</th>
            <th width="150">登录名</th>
            <th width="90">姓名</th>
            <th width="150">内容</th>
            <th width="100">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr class="text-c" th:each="l:${list}">
            <td><input type="checkbox" th:value="${l.id}" name=""></td>
            <td th:text="${l.id}">1</td>
            <td th:text="${l.uname}">admin</td>
            <td th:text="${l.tname}">13000000000</td>
            <td th:text="${l.content}">admin@mail.com</td>
            <td class="td-manage">
                <a title="删除" href="javascript:;" th:onclick="'javascript:admin_del(this,'+${l.id}+')'"
                   class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
<script type="text/javascript">
    /*管理员-删除*/
    function admin_del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: '../user/deleteLog?id=' + id,
                dataType: 'json',
                success: function (data) {
                    layer.msg('已删除!', {icon: 1, time: 1000}, function(){
                        location.replace(location.href);
                    });
                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    }
</script>
</body>
</html>